// Copyright (c) 2021, yuxinyong and contributors
// For license information, please see license.txt

frappe.listview_settings['Plan Order'] = {
	onload: function(listview) {
		listview.page.add_actions_menu_item(__("Bulk Convert"), 
			function(){
				let docnames = listview.get_checked_items(true);
				frappe.call({
					method: "zelin_am.agile_manufacturing.doctype.plan_order.plan_order.bulk_convert",
					args: {docnames: docnames},
					freeze: true,
					freeze_message: __("Running..."),
				})
				.then(	
					r => {
						if (r && r.message) {
							frappe.msgprint(r.message)
						}
					}
				);
			}
		)
	}
};

